package com.xmtlxx.oms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xmtlxx.oms.domain.TaskVideoRecord;
import com.xmtlxx.oms.mapper.TaskVideoRecordMapper;
import com.xmtlxx.oms.service.ITaskVideoRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单视频记录实现
 *
 * @author hergreen
 * @date 2024/10/29 16:14
 **/
@Service
@RequiredArgsConstructor
public class TaskVideoRecordServiceImpl implements ITaskVideoRecordService {

    private final TaskVideoRecordMapper baseMapper;

    @Override
    public List<TaskVideoRecord> getTaskVideoRecord(String taskId) {

        return baseMapper.selectList(new LambdaQueryWrapper<TaskVideoRecord>()
                .eq(TaskVideoRecord::getTaskId, taskId).eq(TaskVideoRecord::getDelFlag, 0));
    }

    @Override
    public boolean insert(TaskVideoRecord taskVideoRecord) {

        return baseMapper.insert(taskVideoRecord) > 0;
    }

    @Override
    public boolean deleteTaskVideoRecord(String id) {

        return baseMapper.updateById(new TaskVideoRecord(id)) > 0;
    }

}
